import MySQLdb as mdb
import sys

con = mdb.connect("localhost", "root", "root", "test")

with con:
    cur = con.cursor()
    cur.execute("UPDATE student SET name = %s WHERE id=%s",
                ("GUY DE BY", "4"))

    print "Number of rows updated: %d" % cur.rowcount
